package com.dongdongshop.service.impl;

import com.dongdongshop.annotation.Log;
import com.dongdongshop.mapper.TbSellerMapper;
import com.dongdongshop.pojo.TbSeller;
import com.dongdongshop.service.TbSellerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@com.alibaba.dubbo.config.annotation.Service
public class TbSellerServiceImpl implements TbSellerService {

    @Autowired
    private TbSellerMapper tbSellerMapper;

    //
    @Override
    @Log
    public void getRegisterInfo(TbSeller tbSeller) {
        tbSellerMapper.insertSelective(tbSeller);
    }


    @Override
    @Log
    public List<TbSeller> getSellerInfo(TbSeller tbSeller) {
        return tbSellerMapper.selectByTbSeller(tbSeller);
    }

    @Override
    @Log
    public TbSeller getSellerByIdInfo(TbSeller tbSeller) {
        return tbSellerMapper.selectByPrimaryKey(tbSeller.getSellerId());
    }

    // 修改状态
    @Override
    @Log
    public void sellerCheck(TbSeller tbSeller) {
        tbSellerMapper.updateByStatus(tbSeller);
    }

    @Override
    @Log
    public TbSeller qurieName(String username) {
        TbSeller tbSeller = tbSellerMapper.selectByName(username);
        return tbSeller;
    }

    @Override
    public TbSeller echo(String sellerId) {
        return tbSellerMapper.selectById(sellerId);
    }
}
